<template>
  <div class="app-container">
    <div class="message-container">
      <h1 class="message">{{ statusText }}</h1>
    </div>
  </div>
</template>

<script>
import { reactive, onMounted } from 'vue';
import { getInfo } from '@/api/manage/user';

export default {
  setup() {
    const data = reactive({
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        idleState: null
      },
    });

    // 定义计算属性
    const statusText = computed(() => {
      if (data.queryParams.idleState === 1) {
        return '无面试';
      } else if (data.queryParams.idleState === 2) {
        return '面试中';
      } else if (data.queryParams.idleState === 3) {
        return '等待二次转厂';
      } else {
        return '未知状态';
      }
    });

    function get() {
      getInfo(data.queryParams).then(response => {
        data.queryParams.idleState = response.data.idleState;
        console.log(data.queryParams.idleState);
      });
    }

    onMounted(() => {
      get();
    });

    return {
      statusText,
    };
  },
};
</script>

<style scoped>
.app-container {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
}

.message-container {
  text-align: center;
  animation: fadeIn 2s ease-in-out forwards;
}

.message {
  font-size: 3rem;
  color: white;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>